package com.gg.zjj.controller;

import com.gg.common.pojo.DFile;
import com.gg.common.pojo.MApply;
import com.gg.zjj.service.ProductionPlanReviewService;
import com.gg.zjj.util.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author koco
 * 2022/10/12
 * 18:12
 */
@Controller
@RequestMapping("/zjj/")
public class ProductionPlanReviewControl {
    @Resource
    private ProductionPlanReviewService planReviewService;


    @RequestMapping("queryTheProductionPlanToBeReviewed.action")
    @ResponseBody
    private Result<List<MApply>> queryTheProductionPlanToBeReviewed(){
        return Result.success(planReviewService.queryTheProductionPlanToBeReviewed());
    }


    @RequestMapping("queryAllProductionPlans.action")
    @ResponseBody
    private Result<List<MApply>> queryAllProductionPlans(){
        return Result.success(planReviewService.queryAllProductionPlansService());
    }

    @RequestMapping("queryPendingProductionPlan.action")
    @ResponseBody
    private Result<List<MApply>> queryPendingProductionPlan(@RequestBody String productionPlanNumber){
        return Result.success(planReviewService.queryPendingProductionPlanService(productionPlanNumber));
    }


    @RequestMapping("queryTheCurrentProductionPlan.action")
    @ResponseBody
    private Result<List<MApply>> queryTheCurrentProductionPlan(@RequestBody String productionPlanNumber){
        return Result.success(planReviewService.queryTheCurrentProductionPlanService(productionPlanNumber));
    }

    @RequestMapping("productionPlanApproved.action")
    @ResponseBody
    private Result productionPlanApproved(@RequestBody String productionPlanNumber){
        planReviewService.productionPlanApprovedService(productionPlanNumber);
        return Result.success();
    }

    @RequestMapping("productionPlanRejection.action")
    @ResponseBody
    private Result productionPlanRejection(@RequestBody String productionPlanNumber){
        planReviewService.productionPlanRejectionService(productionPlanNumber);
        return Result.success();
    }
}
